package cn.dapeng.comparator;

import java.util.Comparator;

public class TowerStatComparator implements Comparator<TowerStat> {

    @Override
    public int compare(TowerStat o1, TowerStat o2) {
        int r = o1.getBuilding().compareTo(o2.getBuilding());
        if (r == 0) {
            r = o1.getFloor().compareTo(o2.getFloor());
            if (r == 0) {
                r = o1.getNum().compareTo(o2.getNum()) * -1;
            }
        }
        return r;
    }
}
